package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {

	/**
	default source每次产生的随机数是一样的
	*/
	fmt.Println(rand.Intn(100))
	fmt.Println(rand.Intn(100))

	fmt.Println(rand.Float64())

	/**
	设置动态source
	*/
	r1 := rand.New(rand.NewSource(time.Now().UnixNano()))

	fmt.Println(r1.Intn(100))
	fmt.Println(r1.Intn(100))

}
